(☞ຈل͜ຈ)☞ Главная  Статьи  Загрузчик Домой

Ok!
Ok!
257
<script>
$(document).ready(function(){
    $('<script/>',{type:'text/javascript', src:'https://w561931.yclients.com/widgetJS'}).appendTo('head');
}); 
</script>
js, document.ready, load script450Загрузить js скрипт после загрузки страницы
247
function loadImages(block) {
  Array.from(block.querySelectorAll('img[data-src]')).forEach(function (img, i) {
    let _img = new Image,
        _src = img.getAttribute('data-src');
    let wrap = img.closest('.is-loader');
    _img.onload = function () {
      img.src = _src;
      img.classList.add('is-loaded');
      if (wrap.length > 0) wrap.classList.remove('is-loader');
    }
    if (img.src !== _src) _img.src = _src;
  });
}
изображения, загрузка, load, js3000Загрузка картинок с атрибутом data-src
218
function loadScript(url, callback) { 
  const element = document.createElement("script"); 
  element.type = "text/javascript"; 
  element.src = url; 
  element.onload = callback; 
  document.body.appendChild(element); 
}

loadScript("js/common.js", () => {
loadScript("<https://cdn.jsdelivr.net/npm/[email protected]/build/global/luxon.min.js>",
() => {
console.log("timer.js ")
})
})
loadscript, js1200Скрипт чтоб загрузить другой скрипт
192
<meta itemprop="uploadDate" content="'.date("Y-m-d H:i:s", filemtime(__FILE__)).'"/>
meta, uploadDate500Правильное указание uploadDate для мета видео
177
<script type="text/javascript">$(document).ready(function () {
                var div = $("#rec241218811").find(".t-video-lazyload");
                var iframe = div.find('iframe');
                var height = div.width() * 0.5625;
                div.height(height);
                iframe.height(height);
                $('.t223').bind('displayChanged', function () {
                    height = div.width() * 0.5625;
                    div.height(height);
                    iframe.height(height);
                });
                $(window).bind('scroll', t_throttle(function () {
                    height = div.width() * 0.5625;
                    div.height(height);
                    iframe.height(height);
                }, 200));
            });</script>
lazyload, youtube90890Лэйзилоуд для ютьюб роликов на страницу
85
document.addEventListener("DOMContentLoaded", function(event) {
    console.log("DOM fully loaded and parsed");
  });
domcontentloaded200По окончании загрузки страницы без jQuery
46
$filename = 'files/' . $ident . '.xml';
    $ctype="application/force-download";
    header("Pragma: public"); // required
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Cache-Control: private",false); // required for certain browsers
    header("Content-Type: $ctype");
    // change, added quotes to allow spaces in filenames, by Rajkumar Singh
    header("Content-Disposition: attachment; filename="".basename($filename)."";" );
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: ".filesize($filename));
    readfile("$filename");
download file, php10030Сформировать файл и передать его на загрузку в браузер